package com.boguan.common.config.jpush;

import cn.jiguang.common.ClientConfig;
import cn.jpush.api.JPushClient;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Component
@Configuration
@ConfigurationProperties(prefix = "jspush")
public class JPushConfiguration {

    private String MASTER_SECRET;

    private String APP_KEY;


    public String getMASTER_SECRET() {
        return MASTER_SECRET;
    }

    public void setMASTER_SECRET(String MASTER_SECRET) {
        this.MASTER_SECRET = MASTER_SECRET;
    }

    public String getAPP_KEY() {
        return APP_KEY;
    }

    public void setAPP_KEY(String APP_KEY) {
        this.APP_KEY = APP_KEY;
    }

    @Bean
    public JPushClient getJPshClient() {
        return new JPushClient(MASTER_SECRET, APP_KEY, null, ClientConfig.getInstance());
    }

}
